Skip to content

Fix serialization of dataflow params - #7759

Merged
bentsherman merged 4 commits into
nextflow-io:masterfrom
pinin4fjords:fix/typed-params-serialization
Oct 5, 2026
Merged

bentsherman merged 4 commits into
nextflow-io:masterfrom
pinin4fjords:fix/typed-params-serialization

Conversation

@pinin4fjords

@pinin4fjords pinin4fjords commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Closes #7758

Summary

Typed Channel and Value parameters are dataflow values and are not bound until the workflow starts. Serializing them directly from session.params breaks the Seqera Platform and lineage observers:

  • Seqera Platform blocks indefinitely while serializing an unbound Channel.
  • A Value parameter produces invalid JSON.
  • Lineage workflow-run records fail to serialize and are not saved.

Dataflow params, including those inside an included pipeline's params record, come from #7213 and are not in a release yet.

Changes

This PR adds a plain-value representation for declared pipeline parameters (ParamsHelper.resolvePlainParams(), exposed as ParamsMap.toPlainMap()).

  • Channel<E> params are represented by their original samplesheet value.
  • Value<V> params are represented by their resolved plain value.
  • Dataflow values nested inside record params are handled recursively.
  • Non-dataflow values resolve to the same values as before, so they serialize the same.
  • Parameter precedence, defaults and type conversion use the existing resolution rules.

The plain representation is used only when serializing observer payloads. Runtime workflow parameters remain unchanged and continue to use the Channel and Value dataflow objects.

The following observers now use the plain representation:

  • Seqera Platform begin and complete requests
  • Lineage workflow-run records

Notes

  • nf-tower now calls ParamsMap.toPlainMap(), so its minimum Nextflow version needs bumping at release.
  • An included pipeline's own param defaults are not shown, as with session.params.

Testing

Added coverage for:

  • Channel and Value params
  • CLI/config precedence and type conversion
  • Default values
  • A Channel param given as a Path in the config
  • Dataflow values inside record params
  • Included pipelines
  • Non-dataflow values unchanged
  • Seqera Platform begin and complete request serialization
  • Lineage workflow-run persistence

Without this change, the new Platform test times out and the lineage test fails to encode, as do the reproductions from #7758. The full nextflow, nf-tower and nf-lineage suites pass.

🤖 Generated with Claude Code

A Channel or Value param is a dataflow value that is bound only when the
dataflow network starts, so serializing the session params on flow begin
blocked the Seqera Platform begin request forever, and the lineage
workflow run record failed to encode and was not saved.

The params block also resolves each declared param to a plain value (the
samplesheet of a Channel param, the converted value of a Value param).
ParamsMap.toPlainMap() replaces each dataflow value in the params,
including the fields of a record param, with its plain value, and keeps
every other value as is. The Seqera Platform and lineage observers use
it in place of the session params.

Assisted-by: Claude Code (Opus 5.5)
Signed-off-by: Jonathan Manning <jonathan.manning@seqera.io>
@netlify

netlify Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for nextflow-docs ready!

Name Link
🔨 Latest commit 2483731
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs/deploys/6ac3c8d6b5977f000927ce68
😎 Deploy Preview https://deploy-preview-7759--nextflow-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Assisted-by: Claude Code (Opus 5.5)
Signed-off-by: Jonathan Manning <jonathan.manning@seqera.io>
Replace ParamsHelper.toPlainValue() with a direct overlay of the plain
values in ParamsMap.toPlainMap(), and replace the resolveParam0() and
resolveDefault0() overloads with a `plain` default argument.

Signed-off-by: Ben Sherman <bentshermann@gmail.com>

@bentsherman bentsherman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the fix end to end against the repro in #7758 (Platform begin/complete and lineage run record). I pushed a small simplification (2ace6c7): toPlainMap() overlays the plain values directly, and the resolveParam0/resolveDefault0 overloads are replaced with a plain default argument.

Remember to bump nf-tower's nextflowVersion at release, since it now calls ParamsMap.toPlainMap().

@bentsherman bentsherman changed the title Fix Seqera Platform and lineage records for Channel and Value params Fix serialization of dataflow params Oct 5, 2026
@bentsherman
bentsherman merged commit 3e6b01d into nextflow-io:master Oct 5, 2026
24 checks passed
@pinin4fjords
pinin4fjords deleted the fix/typed-params-serialization branch October 5, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Seqera Platform run hangs and lineage run record is lost with Channel or Value params

2 participants